package com.ys.controller.api.base;

import com.ys.config.MenuId;
import com.ys.entity.base.TsBatchImportInfo;
import com.ys.enume.base.TsBatchImportLogEnum;
import com.ys.service.sys.CommonApiService;
import com.ys.util.shiro.ShiroUtils;
import com.ys.vo.LayuiTableVoJA;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/api/inter/tsBatchImportInfo")
public class ApiInterTsBatchImportInfoController {
	
	@Autowired
	private CommonApiService<TsBatchImportInfo> commonApiService;

	//菜单id
	private Long menuIdByTosProductBasis = MenuId.TS_BatchImportInfo;
	private Long menuIdByTosProductBasis_TpProductBasis = MenuId.TS_BatchImportInfo_TpProductBasis;



	//权限字符
	private final String PERMISSIONS_VIEW = "tsBatchImportInfo:view";

	//查询
	@RequiresPermissions(PERMISSIONS_VIEW)
	@RequestMapping("/search")
    @ResponseBody
	public LayuiTableVoJA search(@ModelAttribute TsBatchImportInfo cond,String conditions){

		cond.addField("FORMAT(A.CreateTime, 'yyyy-MM-dd HH:mm:ss') AS infoCreateTime");//导入时间
		cond.setUserId(ShiroUtils.getUserId());
		//排序
		cond.setOrderby("A.Id DESC");
		return commonApiService.searchLay(cond);
	}



	//查询-商品库批量导入（内嵌不显示）
	@RequestMapping("/searchTpProductBasis")
	@ResponseBody
	public LayuiTableVoJA searchTpProductBasis(@ModelAttribute TsBatchImportInfo cond,String conditions){

		cond.addField("FORMAT(A.CreateTime, 'yyyy-MM-dd HH:mm:ss') AS infoCreateTime");//导入时间
		cond.setUserId(ShiroUtils.getUserId());

		//排序
		cond.setOrderby("A.Id DESC");
		return commonApiService.searchLay(cond);
	}





}
